home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / attrs.Z / attrs
Encoding:
Text File  |  1998-10-28  |  1.8 KB  |  67 lines

  1.  
  2.  
  3.  
  4.      aaaattttttttrrrrssss((((3333))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))          aaaattttttttrrrrssss((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       attrs    - set/get attributes of    a subroutine
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           sub foo {
  13.           use attrs qw(locked method);
  14.           ...
  15.           }
  16.  
  17.           @a = attrs::get(\&foo);
  18.  
  19.  
  20.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  21.       This module lets you set and get attributes for subroutines.
  22.       Setting attributes takes place at compile time; trying to
  23.       set invalid attribute    names causes a compile-time error.
  24.       Calling attr::get on a subroutine reference or name returns
  25.       its list of attribute    names. Notice that attr::get is    not
  26.       exported.  Valid attributes are as follows.
  27.  
  28.       method
  29.            Indicates that the invoking subroutine is a method.
  30.  
  31.       locked
  32.            Setting this attribute is only meaningful when the
  33.            subroutine or method is to be called by multiple
  34.            threads.    When set on a method subroutine    (i.e. one
  35.            marked with the mmmmeeeetttthhhhoooodddd attribute    above),    perl ensures
  36.            that any    invocation of it implicitly locks its first
  37.            argument    before execution. When set on a    non-method
  38.            subroutine, perl    ensures    that a lock is taken on    the
  39.            subroutine itself before    execution. The semantics of
  40.            the lock    are exactly those of one explicitly taken with
  41.            the lock    operator immediately after the subroutine is
  42.            entered.
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.